package cn.water.luban.demo.order.main;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class RpcClient {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("localhost",8888);
        String name = "王晓峰";
        OutputStream outputStream = socket.getOutputStream();
        DataOutputStream dos = new DataOutputStream(outputStream);
        dos.writeUTF(name);
        DataInputStream dis = new DataInputStream(socket.getInputStream());
        String message  = dis.readUTF();
        System.out.println("服务端回了句+"+message);

    }
}
